// use ferris_says::say; // from the previous step
// use std::io::{stdout, BufWriter};
use std::{thread, time};

mod book;
mod file;
mod fs;
mod types;
mod web;

fn main() {
    // let stdout = stdout();
    // let message = String::from("Hello fellow Rustaceans!");
    // let width = message.chars().count();

    // let mut writer = BufWriter::new(stdout.lock());
    // say(message.as_bytes(), width, &mut writer).unwrap();

    let start = time::Instant::now();

    println!("DEFAULT:{}", types::DEFAULT);
    println!("DEFAULT:{}", types::ENV);

    do_loop();

    thread::sleep(time::Duration::from_secs(1));
    println!("############# book demo #######");
    book::book_demo();

    println!("############# file demo #######");
    file::file_demo();

    println!("duration:{}", start.elapsed().as_secs());
}

fn do_loop() {
    let l = [1, 2, 3, 4];
    for num in l.iter() {
        println!("num:{}", num);
    }
}
